package com.dudu.controller;


import com.alibaba.fastjson.JSONObject;
import com.dudu.domain.Building;
import com.dudu.domain.Floor;
import com.dudu.domain.Room;
import com.dudu.service.FloorService;
import com.dudu.service.RoomService;
import com.dudu.tools.ServletUtil;
import com.dudu.tools.StringUtil;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/** 教程页面
 * Created by tengj on 2017/3/13.
 */
@Controller
@RequestMapping("/floor")
public class FloorController {
    @Autowired
    private FloorService floorService;



    @RequestMapping("/list")
    @ResponseBody
    public ModelAndView queryLearnList(){

        List<Floor> floorList=floorService.getAllFloor();
        for (int i = 0; i < floorList.size(); i++) {
			System.out.println(floorList.get(i).getName());
		}
        ModelAndView modelAndView = new ModelAndView("/floorlist");
        modelAndView.addObject("floorList", floorList);
        return modelAndView;
        
        

    }



}